<?php
/**
 * @description:
 * @author     : Geomen
 * @time       : 2019/2/1 14:55
 */


namespace App\Repositories;


use App\Models\User;

class UserRepository
{
    /** @var User 注入User model */
    protected $user;

    /**
     * UserRepository constructor.
     *
     * @param User $user
     */
    public function __construct(User $user)
    {
        $this->user = $user;
    }

    /**
     * 获取列表
     * @return \Illuminate\Contracts\Pagination\LengthAwarePaginator
     */
    public function list()
    {
        return ($this->user)::query()->latest('updated_at')->paginate();
    }
}